home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
051-075
/
disk_054
/
miditools
/
play.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-06
|
1KB
|
54 lines
/****************************************************************************
Author: Fred Cassirer
Date: January 24, 1987
This program is placed in the public domain, and from what I understand
that means anyone can do whatever they want with it. That's fine
because they are fairly trivial anyway ... If you can get someone to pay
you for them, you must be doing something right.
****************************************************************************/
#include "stdio.h"
#include "exec/types.h"
#include "midi.h"
#undef GETMIDI
#define GETMIDI(t) if (scanf("%x",&t) != 1) t = NON_MIDI_EVENT;
main()
{
FILE *fp;
int i=0;
int midi,timetag;
if ( (fp=fopen("ser:31250,n,8,1","w")) == NULL) {
printf("Could not open serial port for write!/n");
exit(1);
}
GETMIDI(midi); /* First stuff is bogus timetag */
GETMIDI(midi); /* Eat timetag .. munch .. munch crunch */
GETMIDI(midi); /* First true midi stuff */
while (midi != NON_MIDI_EVENT) {
if ( midi == TIMETAG ) {
GETMIDI(timetag);
if ( timetag ) {
Delay( (long) timetag ); /* 60th's of second */
}
GETMIDI(midi);
}
else
do {
putc(midi,fp);
GETMIDI(midi);
} while ( ( midi != TIMETAG) && ( midi != NON_MIDI_EVENT) );
}
}